home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr48 / ifp1s157.zip / PAGE_15.PAS < prev    next >
Pascal/Delphi Source File  |  1993-06-26  |  6KB  |  206 lines

  1. unit page_15;
  2.  
  3. interface
  4.  
  5. uses crt, ifpglobl, ifpcomon;
  6.  
  7. procedure page15;
  8.  
  9. implementation
  10.  
  11. procedure page15;
  12.  
  13. var
  14.   drive : byte;
  15.   j : 0..3;
  16.   k : byte;
  17.   part : array[0..secsiz - 1] of byte;
  18.   EndOfDrives : boolean;
  19.   ValidDrive : boolean;
  20.   LastDrive : boolean;
  21.   AnotherDrive : boolean;
  22.   xbyte : byte;
  23.   xlong : longint;
  24.   xword : word;
  25.  
  26.   begin
  27.   caption2('Partition table data');
  28.   if ReadPartitionTable then
  29.     begin
  30.     drive:=$80;
  31.     EndOfDrives:=false;
  32.     ValidDrive:=false;
  33.     repeat
  34.       with regs do
  35.         begin
  36.         AX:=$0201;
  37.         CX:=$0001;
  38.         DX:=drive;
  39.         ES:=Seg(part);
  40.         BX:=Ofs(part);
  41.         Intr($13, regs);
  42.         if NoCarry(regs) then
  43.           begin
  44.           EndOfDrives:=true;
  45.           ValidDrive:=true
  46.           end
  47.         else
  48.           if drive < $99 then
  49.             Inc(drive)
  50.           else
  51.             EndOfDrives:=true
  52.         end
  53.     until EndOfDrives;
  54.     if ValidDrive then
  55.       begin
  56.       Writeln;
  57.       caption3('Unit');
  58.       Writeln;
  59.       caption3('Partition');
  60.       Writeln;
  61.       caption3('Bootable');
  62.       Writeln;
  63.       caption3('Starting head');
  64.       Writeln;
  65.       caption3('Starting sector');
  66.       Writeln;
  67.       caption3('Starting cylinder');
  68.       Writeln;
  69.       caption3('System ID');
  70.       Writeln;
  71.       caption3('Ending head');
  72.       Writeln;
  73.       caption3('Ending sector');
  74.       Writeln;
  75.       caption3('Ending cylinder');
  76.       Writeln;
  77.       caption3('First partition sector');
  78.       Writeln;
  79.       caption3('Sectors in partition');
  80.       Writeln;
  81.       LastDrive:=false;
  82.       repeat
  83.         Window(9, 4, twidth, tlength - 2);
  84.         Writeln(drive);
  85.         Window(27, 5, twidth, tlength - 2);
  86.         ClrScr;
  87.         for j:=0 to 3 do
  88.           begin
  89.           Window(27 + 12 * j, 5, 38 + 12 * j, tlength - 2);
  90.           Writeln(j + 1);
  91.           xword:=$01BE + j shl 4;
  92.           xbyte:=part[xword];
  93.           case xbyte of
  94.             $00 : Writeln('no');
  95.             $80 : Writeln('yes')
  96.           else
  97.               Writeln('(', hex(xbyte, 2), ')')
  98.           end;
  99.           xbyte:=part[xword + 4];
  100.           if xbyte > $00 then
  101.             begin
  102.             Writeln(part[xword + 1]);
  103.             Writeln(part[xword + 2] and $3F);
  104.             Writeln(part[xword + 3] +
  105.               word(part[xword + 2] shr 6 * 256));
  106.             case xbyte of
  107.               $00 : Write('None');
  108.               $01 : Write('DOS-12');
  109.               $02 : Write('XENIX root');
  110.               $03 : Write('XENIX /usr');
  111.               $04 : Write('DOS-16');
  112.               $05 : Write('Ext DOS-16');
  113.               $06 : Write('Big DOS-16');
  114.               $07 : Write('OS/2 HPFS');
  115.               $08 : Write('AIX data');
  116.               $09 : Write('AIX boot');
  117.               $0A : Write('OS/2 BtMngr');
  118.               $10 : Write('OPUS');
  119.               $40 : Write('VENIX 286');
  120.               $44 : Write('386BSD');
  121.               $50 : Write('DskMngrR/O');
  122.               $51 : Write('Dsk Managr');
  123.               $52 : Write('CP/M');
  124.               $56 : Write('GB Vfeatre');
  125.               $61 : Write('Speedstor');
  126.               $63 : Write('SysV/386');
  127.               $64 : Write('NOVELL');
  128.               $75 : Write('PC/IX');
  129.               $80 : Write('Minix v1.3-');
  130.               $81 : Write('Minix v1.4+');
  131.               $82 : Write('Minix Swap');
  132.               $83 : Write('Linux extd');
  133.               $93 : Write('Amoeba file');
  134.               $94 : Write('Amoeba BBT');
  135.               $B7 : Write('BSDI file');
  136.               $BB : Write('BSDI swap');
  137.               $C6 : Write('DRDOSsecure');
  138.               $C7 : Write('Cyrnix boot');
  139.               $DB : Write('CP/M');
  140.               $E1 : Write('SpdStr-12');
  141.               $E3 : Write('SpdStr R/O');
  142.               $E4 : Write('SpdStr-16');
  143.               $F2 : Write('DOS secndry');
  144.               $FE : Write('LANstep');
  145.               $FF : Write('Xenix BBT')
  146.             else
  147.               Write('(', hex(xbyte, 2), ')')
  148.             end;
  149.             Writeln;
  150.             Writeln(part[xword + 5]);
  151.             xbyte:=part[xword + 6];
  152.             Writeln(xbyte and $3F);
  153.             Writeln(cbw(part[xword + 7], xbyte shr 6));
  154.             xlong:=0;
  155.             for k:=11 downto 8 do
  156.               xlong:=xlong shl 8 + part[xword + k];
  157.             Writeln(xlong);
  158.             xlong:=0;
  159.             for k:=15 downto 12 do
  160.               xlong:=xlong shl 8 + part[xword + k];
  161.             Writeln(xlong)
  162.           end
  163.         else
  164.            for k:=1 to 9 do
  165.              Writeln('-')
  166.         end;
  167.         AnotherDrive:=false;
  168.         repeat
  169.           if drive < $99 then
  170.             begin
  171.             Inc(drive);
  172.             with regs do
  173.               begin
  174.               AX:=$0201;
  175.               CX:=$0001;
  176.               DX:=drive;
  177.               ES:=Seg(part);
  178.               BX:=Ofs(part);
  179.               Intr($13, regs);
  180.               if NoCarry(regs) then
  181.                 begin
  182.                 AnotherDrive:=true;
  183.                 Pause1;
  184.                 if endit then
  185.                   Exit;
  186.                 end
  187.               end
  188.             end
  189.           else
  190.             begin
  191.             LastDrive:=true;
  192.             AnotherDrive:=true
  193.             end
  194.         until AnotherDrive
  195.       until LastDrive
  196.       end
  197.     else
  198.       Writeln('(no fixed disks)')
  199.     end
  200.   else
  201.     begin
  202.     Writeln;
  203.     Writeln('Reading of Partition Table blocked by NP command-line switch!!');
  204.     end;
  205.   end;
  206. end.